package com.es.app.pojo;


import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

/**
 * indexName：索引名称 可以理解为数据库名 必须为小写 不然会报org.elasticsearch.indices.InvalidIndexNameException异常
 * type：类型 可以理解为表名
 * @Document作用在类，@Id、@Field作用在成员变量，@Id标记一个字段作为id主键。
 * */
@Document(indexName = "test",type = "news")
public class Book {

    @Id
    private Integer id;
    private String book_name;
    private String book_price;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBook_name() {
        return book_name;
    }

    public void setBook_name(String book_name) {
        this.book_name = book_name;
    }

    public String getBook_price() {
        return book_price;
    }

    public void setBook_price(String book_price) {
        this.book_price = book_price;
    }

    @Override
    public String toString() {
        return "Book{" +
                "id=" + id +
                ", book_name='" + book_name + '\'' +
                ", book_price='" + book_price + '\'' +
                '}';
    }
}
